package com.cloud.seatarmtwo.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface Seata_TCC_Service {

    /**
     * 调用 seata 的 tcc 模式
     * @param businessActionContext
     * @return
     */
    @TwoPhaseBusinessAction(name="tccAction",commitMethod = "commitTCC",rollbackMethod = "rollbackTCC")
    String test_TCC(BusinessActionContext businessActionContext);

    /**
     * tcc 的提交方法
     * @param businessActionContext
     * @return
     */
    boolean commitTCC(BusinessActionContext businessActionContext);

    /**
     * tcc 的 回滚方法
     * @param businessActionContext
     * @return
     */
    boolean rollbackTCC(BusinessActionContext businessActionContext);


}
